FROM alpine
LABEL name=nat-tool

WORKDIR /app
COPY . .
COPY Shanghai /etc/localtime
VOLUME ["/app/tool"]
RUN chmod +x setup \
    && chmod +x tool/npc \
    && chmod +x tool/ddns-go \
    && echo "Asia/Shanghai" > /etc/timezone \
    && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
    && apk add --no-cache tzdata
EXPOSE 9876
EXPOSE 8191
ENTRYPOINT ["/app/setup"]
CMD ["-config", "tool/nat-tool.conf"]
